#!/bin/bash

user=$1
server=$2
scriptfile=$3
keyfile=$4

cat ${scriptfile} |xargs ssh -i ${keyfile} ${user}@${server}